package com.liang.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//等价于<bean id="user" class="com.liang.pojo.User"></bean>
//@Component 组件
@Component
@Scope("singleton")
public class User {
    //相当于<property name="name" value="猜猜呗"/>
    @Value("猜猜呗")
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                '}';
    }
}
